

<p-growl [(value)]="msgs"></p-growl>

<div class="container">
  <p>{{blog | json}}</p>
  <div class="row">

    <!-- Blog Entries Column -->
    <div class="col-md-8">

      <!-- Blog Post -->
      <div class="panel panel-default">
        <form class="form-group">
          <input type="text" class="form-control" [(ngModel)]="blog.title" name="title" placeholder="请填写博客标题" maxlength="50">

          <textarea class="form-control" [(ngModel)]="blog.summary" name="summary" placeholder="请填写博客摘要" maxlength="300" rows="4"></textarea>

          <hr>
          <p-editor [(ngModel)]="blog.htmlContent" [style]="{'height':'320px'}" name="peditor"></p-editor>
          <p>Value: {{blog.htmlContent||'empty'}}</p>

          <button pButton type="button" label="Clear" icon="fa-close" (click)="blog.htmlContent=null"></button>
          <hr>
        </form>

      </div>

    </div>

    <!-- 右侧栏目 -->
    <div class="col-md-4">
      <!-- 文章目录 -->
      <div class="panel panel-default ">
        <div class="panel-heading">
          <h5 class="panel-title"><i class="fa fa-file-image-o" aria-hidden="true"></i> 图片上传</h5>
        </div>
        <div class="row">
          <div class="col-lg-12 form-group">
            <form enctype="multipart/form-data" id="uploadformid">
              <input type="file" class="form-control" name="file" accept="image/png,image/gif,image/jpeg" id="file">
              <button class="btn btn-primary" style="float:right;margin-right: 10px;margin-top: 10px" type="button"
                      id="uploadImage">插入
              </button>
            </form>
          </div>
        </div>


      </div>
      <!-- 图片上传 -->
      <div class="panel panel-default form-group">
        <div class="panel-heading">
          <h5 class="panel-title"><i class="fa fa-cog" aria-hidden="true"></i> 博客设置</h5>
        </div>


        <div class="row">
          <div class="col-lg-12 ">
            <label class="control-label">标签： </label>
            <input type="text" class="form-control" [(ngModel)]="blog.tags">
          </div>
        </div>
        <div class="row">
          <div class="col-lg-12  mt-1">
            <label class="control-label">分类：</label>
            <select id="catalogSelect" class="form-control" data-placeholder="请选择" [(ngModel)]="blog.catalog.id">
              <option *ngFor="let catalog of catalogs;let i=index" [value]="catalog.id">{{catalog.name}}
              </option>
            </select>
          </div>
        </div>
        <div class="row mt-1">
          <div class="col-lg-12">
            <button class="btn btn-primary" (click)="onSubmit();" style="float:right;margin-right: 10px;margin-top: 10px" id="submitBlog">
              发布
            </button>
          </div>
        </div>


      </div>
    </div>

  </div>

</div>
